package ch.unisi.inf.java.project.riskbami.model;

import java.util.ArrayList;
import java.util.Random;

/**
 * Class Card to model the cards in the game.
 * 
 * @author minellir@lu.unisi.ch
 * @author babazadm@lu.unisi.ch
 */
public final class Card
{
    private final int id;
    private final CardType type;
    private final Country country;
    
    /**
     * The contructor for the class Card
     * 
     * @param type The type of the card
     * @param country The country that is on the card
     */
    public Card(final int id, final CardType type, final Country country){
        this.id = id;
        this.type = type;
        this.country = country;
    }
    
    /**
     * getType returns the type of the card
     * 
     * @return CardType The type of the card
     */
    public final CardType getType(){
        return type;
    }
    
    /**
     * getId returns the ID of the card
     * 
     * @return int The id of the card
     */
    public final int getId(){
        return id;
    }
    
    /**
     * getCountry returns the name of the country written on the card
     * 
     * @return Country The name of the country written on the card
     */
    public final Country getCountry(){
        return country;
    }
    
    /**
     * toString implememtation for the class Card
     * 
     * @return String
     */
    public String toString(){
        String id = "id: "+ this.id +", ";
        String countryName;
        String type = "Type: " + this.type +", ";
        
        if (this.country == null){
            countryName = "";
        } else { countryName = "Country: " + country;}
        return id+type+countryName+"\n";
    }
}
